/*
-----------------------------------------------------------------------------
Filename:    menuCEGUI.h

-----------------------------------------------------------------------------
*/
#ifndef __menuCEGUI_h_
#define __menuCEGUI_h_
 
#include "BaseApplication.h"
 
#include <CEGUI/CEGUI.h>
#include <CEGUI/RendererModules/Ogre/CEGUIOgreRenderer.h>
 
class menuCEGUI : public BaseApplication
{
public:
    menuCEGUI(void);
    virtual ~menuCEGUI(void);
 
protected:
    CEGUI::OgreRenderer* mRenderer;
	CEGUI::System* mGUISystem;
    virtual void createScene(void);
	
    //virtual void createFrameListener(void);

	//Sheet's functions
	virtual void createSheetPrincipal(CEGUI::WindowManager &wmgr);
	virtual void createSheetModes(CEGUI::WindowManager  &wmgr);
	virtual void createSheetSelectShip(CEGUI::WindowManager  &wmgr);

	virtual void createSheetInterface(CEGUI::WindowManager  &wmgr);
	virtual void createSheetInterface2(CEGUI::WindowManager &wmgr);

	virtual void createSheetOptions(CEGUI::WindowManager &wmgr);
	
    // Ogre::FrameListener
    virtual bool frameRenderingQueued(const Ogre::FrameEvent& evt);
 
    // OIS::KeyListener
    virtual bool keyPressed( const OIS::KeyEvent &arg );
    virtual bool keyReleased( const OIS::KeyEvent &arg );
    // OIS::MouseListener
    virtual bool mouseMoved( const OIS::MouseEvent &arg );
    virtual bool mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id );
    virtual bool mouseReleased( const OIS::MouseEvent &arg, OIS::MouseButtonID id );
 
    bool quit(const CEGUI::EventArgs &e);
	bool quick_start(const CEGUI::EventArgs &e);
	bool clickOnBackground(const CEGUI::EventArgs &e);
	bool options(const CEGUI::EventArgs &e);
	bool mode(const CEGUI::EventArgs &e);
	bool clickSingle(const CEGUI::EventArgs &e);
	bool clickMultiplayer(const CEGUI::EventArgs &e);
	bool leftSelectionButton(const CEGUI::EventArgs &e);
	bool rightSelectionButton(const CEGUI::EventArgs &e);
	bool startGameButton(const CEGUI::EventArgs &e);
	bool enableSound(const CEGUI::EventArgs &e);

	CEGUI::WindowManager *wmgr;
	//sheets
	CEGUI::Window *sheet_principal;
	CEGUI::Window *sheet_select_ship;
	CEGUI::Window *sheet_modes;
	// interfaces
	CEGUI::Window *sheet_interface, *sheet_interface2;
	CEGUI::Window *sheet_options;
	CEGUI::Window *bg1 , *bg2, *bg3, *bg4, *bg5;

	CEGUI::Window *sheet_time_start;
	CEGUI::Window *sheet_victory;
	
	//buttons on inicial screen
	CEGUI::Window *quit_button;
	CEGUI::Window *quick_start_button;
	CEGUI::Window *options_button;
	CEGUI::Window *mode_button;
	
	//buttons on options mode
	CEGUI::Window *sound_button;

	//buttons on mode screen
	CEGUI::Window *mode_single;
	CEGUI::Window *mode_multiplayer;
	
	//buttons on single mode
	CEGUI::Window *left_button;
	CEGUI::Window *right_button;
	CEGUI::Window *start_game;

	// naves
	CEGUI::Window *winNaves;
	CEGUI::String *tipoNave;
	int indexTipoNave, nNaves;
	Ogre::String *mShipModel;
	
	// Contadores P1 y P2
	CEGUI::Window *cont_time;
	CEGUI::Window *cont_points1, *cont_points2 ;
	CEGUI::Window *cont_speed1, *cont_speed2 ;
	float mCounterTime;
	// Cambiar Single y Multiplayer Interfaz
	void changeMultiplayer(bool multi);

	// variables
	char buffer[33];
	bool mSoundOn;
	bool multiplayerOn;

	// controlar juego ON
	bool mGAMEON;
	// controlar inicio
	bool mSTART;
	// controlar Fin Victoria
	int mVictory;
	
};
 
#endif // #ifndef __menuCEGUI_h_